package fivm.cross.platform.steamobj.log;

import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName;
import fivm.cross.platform.ficommon.distinguish.GsonSimpleSerializable;

/**
 * Created by Administrator on 2016/5/19.
 * 考虑客户端的环境复杂。不易调试。
 * 所以采用将log上传回服务来处理
 *
 */
public class LogConfigStream extends GsonSimpleSerializable {
    //debuglevel
    public static final int DEBUG_LEVEL_VERBOSE=2;
    public static final int DEBUG_LEVEL_DEBUG=3;
    public static final int DEBUG_LEVEL_INFO=4;
    public static final int DEBUG_LEVEL_WARN=5;
    public static final int DEBUG_LEVEL_ERROR=6;
    public static final int DEBUG_LEVEL_ASSERT=7;

    @Expose @SerializedName("Debug")
    private boolean Debug=false;

    public final static int LOG_STD_OUT=0;      //打到标准输出流
    public final static int LOG_ADB=1;          //打到adb logcat
    public final static int LOG_Native_FILE=2;  //打到自定义文件
    public final static int LOG_TO_SERVER=3;    //打到服务器来



    @Expose @SerializedName("LogEnvironmentType")
    private int logEnvironmentType=LOG_STD_OUT; //log的输出方法
    @Expose @SerializedName("DebugLevel")
    private int DebugLevel=3;
    @Expose @SerializedName("EnableWaitForDebug")
    private boolean EnableWaitForDebug=false;
    @Expose @SerializedName("EnableChangeParam")
    private boolean EnableChangeParam=false;
    @Expose @SerializedName("EnableReLog")
    private boolean EnableReLog=true;
    @Expose @SerializedName("EnableTestCase")
    private boolean EnableTestCase=true;
    //log路径应该是放在这里才对
    @Expose @SerializedName("LogWinClientFilePath")    //客户端的log路径
    private String logWinClientFilePath ="E:/Project/SpVm/src/TestDir/log.txt";
    @Expose @SerializedName("LogDroidClientFilePath")    //客户端的log路径
    private String logDroidClientFilePath ="/data/local/tmp/vmtools/SysDaemonLog";
    @Expose @SerializedName("LogServletFilePath")   //服务端的log路径
    private String logServletFilePath ="";
    @Expose @SerializedName("Environment")          //环境名，比如系统的log，或者zygote的环境或者是app环境里面
    private String environment ="";
    @Expose @SerializedName("EnableWindowsTestCase")
    private boolean enableWindowsTestCase=false;    //是否开启windows的测试log



    public static LogConfigStream GlobalTestWinCaseLogConfig =new LogConfigStream();//在windows上测试的log config
    public static LogConfigStream InitSysLogConfig =new LogConfigStream(); //最开始系统加载的log config
    public static LogConfigStream InitZygoteLogConfig =new LogConfigStream(); //最开始系统加载的log config

    static {
        GlobalTestWinCaseLogConfig.setDebug(true);
        GlobalTestWinCaseLogConfig.setDebugLevel(DEBUG_LEVEL_VERBOSE);
        GlobalTestWinCaseLogConfig.setEnableChangeParam(false);
        GlobalTestWinCaseLogConfig.setEnableReLog(false);
        GlobalTestWinCaseLogConfig.setLogEnvironmentType(LOG_STD_OUT);
        GlobalTestWinCaseLogConfig.setEnableWaitForDebug(false);
        GlobalTestWinCaseLogConfig.setEnableWindowsTestCase(true);
        GlobalTestWinCaseLogConfig.setEnvironment("sys");


        //最开始系统加载的log config
        //路径就按照初始化的
        InitSysLogConfig.setDebug(true);
        InitSysLogConfig.setDebugLevel(DEBUG_LEVEL_VERBOSE);
        InitSysLogConfig.setEnableChangeParam(false);
        InitSysLogConfig.setEnableReLog(false);
        InitSysLogConfig.setLogEnvironmentType(LOG_STD_OUT);
        InitSysLogConfig.setEnableWaitForDebug(false);
        InitSysLogConfig.setEnableWindowsTestCase(false);
        InitSysLogConfig.setEnvironment("sys");

        //zygote的
        InitZygoteLogConfig.setDebug(true);
        InitZygoteLogConfig.setDebugLevel(DEBUG_LEVEL_VERBOSE);
        InitZygoteLogConfig.setEnableChangeParam(false);
        InitZygoteLogConfig.setEnableReLog(false);
        InitZygoteLogConfig.setLogEnvironmentType(LOG_ADB);
        InitZygoteLogConfig.setEnableWaitForDebug(false);
        InitZygoteLogConfig.setEnableWindowsTestCase(false);
        InitZygoteLogConfig.setEnvironment("zygote");

    }







    public boolean isDebug() {
        return Debug;
    }

    public void setDebug(boolean debug) {
        Debug = debug;
    }

    public int getDebugLevel() {
        return DebugLevel;
    }

    public void setDebugLevel(int debugLevel) {
        DebugLevel = debugLevel;
    }

    public boolean isEnableWaitForDebug() {
        return EnableWaitForDebug;
    }

    public void setEnableWaitForDebug(boolean enableWaitForDebug) {
        EnableWaitForDebug = enableWaitForDebug;
    }

    public boolean isEnableChangeParam() {
        return EnableChangeParam;
    }

    public void setEnableChangeParam(boolean enableChangeParam) {
        EnableChangeParam = enableChangeParam;
    }

    public boolean isEnableReLog() {
        return EnableReLog;
    }

    public void setEnableReLog(boolean enableReLog) {
        EnableReLog = enableReLog;
    }

    public boolean isEnableTestCase() {
        return EnableTestCase;
    }

    public void setEnableTestCase(boolean enableTestCase) {
        EnableTestCase = enableTestCase;
    }



    public String getLogServletFilePath() {
        return logServletFilePath;
    }

    public void setLogServletFilePath(String logServletFilePath) {
        this.logServletFilePath = logServletFilePath;
    }


    public String getEnvironment() {
        return environment;
    }

    public void setEnvironment(String environment) {
        this.environment = environment;
    }

    public String getLogWinClientFilePath() {
        return logWinClientFilePath;
    }

    public void setLogWinClientFilePath(String logWinClientFilePath) {
        this.logWinClientFilePath = logWinClientFilePath;
    }

    public String getLogDroidClientFilePath() {
        return logDroidClientFilePath;
    }

    public void setLogDroidClientFilePath(String logDroidClientFilePath) {
        this.logDroidClientFilePath = logDroidClientFilePath;
    }

    public boolean isEnableWindowsTestCase() {
        return enableWindowsTestCase;
    }

    public void setEnableWindowsTestCase(boolean enableWindowsTestCase) {
        this.enableWindowsTestCase = enableWindowsTestCase;
    }


    public int getLogEnvironmentType() {
        return logEnvironmentType;
    }

    public void setLogEnvironmentType(int logEnvironmentType) {
        this.logEnvironmentType = logEnvironmentType;
    }
}
